package com.IR.fenxiao.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.IR.shop.mapper.DistributionMapper;
import com.IR.shop.po.Distribution;

@Service
public class ADistributionBiz {
	@Resource
	public DistributionMapper dismapper;
	//添加信息id，姓名
	@SuppressWarnings("finally")
	public int saveDistributionid1(Long did,Long dxid,String dname,String dxname) {
		Distribution dis = new Distribution();
		//Long did = 20180906205001225l;
		//Long dxid = 20180906204904137l;
		//String dname="小明";
		//String dxname = "小王";
		dis.setDid(did);
		dis.setDname(dname);
		dis.setDxid(dxid);
		dis.setDxname(dxname);
		int result =0;
		try {
			result= dismapper.insert(dis);
		} finally {
			return result;
		}
	}
	//添加信息两个id
	@SuppressWarnings("finally")
	public int saveDistributionid2(Long did,Long dxid) {
		Distribution dis = new Distribution();
		dis.setDid(did);
		dis.setDxid(dxid);
		int result =0;
		try {
			result= dismapper.insert(dis);
		} finally {
			return result;
		}
	}
}
